using System;
using System.Collections.Generic;
using System.Text;

namespace SanFS.MediaChangerLibrary
{
    public class StorageElementFactory
    {
        private static Dictionary<string, IStorageElementFactoryHelper> mRegistry = new Dictionary<string, IStorageElementFactoryHelper>();

        static StorageElementFactory()
        {
            RegisterStorageElementType(new DataTransferStorageElement());
            RegisterStorageElementType(new NormalStorageElement());
            RegisterStorageElementType(new ImportExportStorageElement());
        }

        private static void RegisterStorageElementType(IStorageElementFactoryHelper Element)
        {
            mRegistry.Add(Element.Key, Element);
        }

        public static IStorageElement CreateStorageElement(ElementType Type, IMediaChanger MediaChanger, int DeviceSlot, LoadStatus Status)
        {
            return mRegistry[Type.ToString()].CreateInstance(MediaChanger, DeviceSlot, Status);
        }
    }  // END CLASS
}  // END NAMESPACE
